package org.rockNarwhal.util;

import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.apache.shiro.crypto.hash.SimpleHash;

public class EncodeUtil {
    public static String algorithmName="md5";
    public static int hashIterations=2;

    public static String getEncodePassword(String password,String salt,String algorithmName,int times){
        return new SimpleHash(algorithmName,password,salt,times).toString();
    }

    public static String getSalt(){
        return new SecureRandomNumberGenerator().nextBytes().toString();
    }
}
